Automated markup language layout

ABSTRACT

Methods and computer programs for automatically creating a text layout in a markup language design for a product to be printed. A number of defined text elements are available for user text. The layout is based on the text elements having user text content. Text elements without text content are disregarded. Positioning of the text elements is determined based on the height of the text elements, defined text element spacing distances, and a defined positioning order. Creating a layout may include positioning design elements relative to the text elements. Font sizes and spacing distances are automatically reduced if necessary to create a suitable layout.

FIELD OF THE INVENTION

This invention relates to the creation of customized markup languagedesigns.

BACKGROUND OF THE INVENTION

Printing services Web sites that allow a user to access the site fromthe user's home or work and design a personalized document are wellknown and widely used by many consumers, professionals, and businesses.Typically, these types of sites allow the user to review thumbnailimages of a number of customizable designs prepared by the site operatorwith a variety of different styles, formats, backgrounds, color schemes,fonts and designs from which the user may choose. When the user hasselected a specific template design to customize, the sites typicallyprovide online tools allowing the user to incorporate the user'spersonal information into the selected template to create a customdocument design. When the design is completed to the user'ssatisfaction, the user can place an order through the site forproduction and delivery of a desired quantity of the correspondingprinted product.

One very common printed product that is often ordered through printingservices sites is the business card. The type of information that isnormally provided on a typical business card is well known and can befairly reliably predicted. To facilitate the easy and rapid preparationof a business card, printing services sites often provide a simple textentry tool that can be easily used by customers with little or no onlineproduct design experience.

Referring to FIG. 1, a representative online business card creationscreen displayed to a user at the user's computer system is depicted. Inthis example, text entry fields 101-111 into which the user can type thedesired information are provided. To assist the user, each text entryfield 101-111 has an associated text label indicating the specificinformation the services provider recommends that the user enter intothat field. For example, field 101 is indicated as the field forentering the user's company name, field 102 is the field for the user'scompany message, and so forth. The fields are normally empty wheninitially displayed to the user.

Template image 120 is the particular business card design templateselected by the user for customization. In the example shown in FIG. 1,template image 120 contains an image area 121 and a text entry area 122.Template 120 is merely representative and other template designs couldhave one or more images of different sizes and/or positions or no imagesat all.

The service provider will typically have specified a default font, fontsize, and other font characteristics in which each user text entry willbe displayed. To illustrate to the user the location and appearance ofthe user's information as it will appear in the design, generic textentries such as “Company Name”, “Full Name” and so forth are initiallydisplayed in template 120. Preview button 130 is provided to allow theuser to cause template 120 to be updated to replace the default generictext information in text area 122 with the information entered by theuser in fields 101-111. Display 100 may also include various otheritems, not shown, such as informational, navigational, and promotionalbanners, messages and links.

Because the user is interacting with the service provider's site using aWeb browser program running on the user's computer system, the documentcreation tools and displays are provided by the server to the user'scomputer in a markup language such as XHTML (eXtensible Hypertext MarkupLanguage) suitable for execution by the browser program. What the usersees on the user's display as the design of a business card is theresult of the browser's rendering of a collection of discrete markuplanguage elements.

Each text entry field 101-111 is associated with an individual textbox.The individual textbox elements of template 120 are depicted forillustration in FIG. 2. Text entry fields 101-111 correspond totextboxes 201-211. As is well understood by those of skill in the art,each textbox element will have a number of associated parameters. Someparameters relate to the displaying of the text in the textbox, such asthe font to be used, font size, font color, and font attributes such asbolding or italics. Other parameters relate to the textbox itself, suchas the width of the textbox, the absolute or relative position of thetextbox, and whether or not text wrapping is enabled.

In a typical prior art application of this type of design system, eachtextbox element is assigned a fixed absolute position within the overalltemplate 120 design. For example, the horizontal and vertical pixeloffset of the upper left corner of each textbox, such as corner 220 oftext box 201, relative to the upper left corner 221 of the template 120image is defined for each textbox 201-211. While this type of inflexibledesign may result in an acceptable finished product in many cases, insome situations the product design will be aesthetically unpleasing orpossibly so defective as to be completely unusable.

While template 120 has been designed to yield a pleasing card containingeleven common business card data entries, some users have no use ordesire for eleven different entries. The user is not forced to make anentry in each field and may choose to leave one or more fields empty. Ifa user makes entries in only a few of the fields, spacing betweenentries in the product design may be uneven and unattractive. Forexample, if a user entered only a company name in text field 101, a namein text field 103, and a Web address in field 111, the resulting threelines of information displayed in textboxes 201, 203 and 211 would bewidely separated over almost the entire height of the card.

Another drawback in the prior art is that the template 120 layout designanticipates that all entries by a user will fit on one line. A problemis created if the user enters more text than the textbox can accommodateon a single line. If text wrapping for a textbox is not enabled, theuser's desired text will exceed the line capacity and will be truncated.If text wrapping is enabled, when the user's text exceeds the capacityof a single line, the text will be wrapped onto a second line, oftenresulting in the text content of one textbox overlapping the textcontent of another textbox, creating an unusable design. Both of thesesituations are clearly undesirable.

There is, therefore, a need for a flexible design layout method thatautomatically adjusts the design according to the text entries made bythe user.

SUMMARY

The present invention is directed at satisfying the need for automatedgeneration of aesthetically pleasing text layouts in a markup languagedesign.

In accordance with one aspect of the invention, a plurality of textelements are defined for receiving user text for incorporation into amarkup language design. In creating a text layout, text elements havingno text content are disregarded. Positions of the text elements havingtext content are determined based on the heights of the text elements,defined spacing distances between adjacent text elements, and thedefined text element positioning order.

It is an advantage of the invention that attractive text layouts can beautomatically created for a wide variety of user text entry choices.

These and other objects, features and advantages of the invention willbe better understood with reference to the accompanying drawings,description and claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an initial document customization screen.

FIG. 2 shows the textbox elements of template 120.

FIG. 3 shows a representative system with which the invention may beemployed

FIG. 4 shows a document customization screen.

FIG. 5 shows the textbox elements and spacing of template 120 accordingto one embodiment of the invention.

FIG. 6 shows a flow chart of one embodiment of the invention.

FIGS. 7A-7D depict illustrative product designs created according to oneembodiment of the invention.

FIG. 8A-8B depict an alternate embodiment incorporating a design elementin the template text area.

DETAILED DESCRIPTION

For the purposes of illustration and discussion, the invention will bedescribed in the context of the online design of a business card. Itwill be understood that the invention is not so limited and can beemployed in any type of customization application where there is arequirement or desire to automatically create a layout within a definedarea of a markup language design.

FIG. 3 depicts a typical system with which the invention may beemployed. User computer system UCS 300 includes processor 301 and memory302. Memory 302 represents all UCS 300 components and subsystems thatprovide data storage, such as RAM, ROM, and hard drives. In addition toproviding permanent storage for all programs installed on UCS 300,memory 302 also provides temporary storage required by the operatingsystem and the applications while they are executing. In a preferredembodiment, UCS 300 is a typically equipped personal computer, but UCS300 could also be a portable computer, a tablet computer, or otherdevice. The user views images from UCS 300 on display 340, such as a CRTor LCD screen, and provides inputs to UCS 300 via input devices 330,such as a keyboard and a mouse.

When UCS 300 is operating, an instance of the USC 300 operating system,for example a version of the Microsoft Windows operating system, will berunning, represented in FIG. 3 by operating system 303. In addition, theuser may be running one or more application programs Applications 304.In FIG. 3, UCS 300 is running Web browser 305, such as Internet Explorerfrom Microsoft Corporation. In the depicted embodiment, design tools 306is a product design program downloaded to UCS 300 via network 320 fromremote server 310, such as downloadable design tools provided byVistaPrint Limited and publicly available at vistaprint.com. Designtools 306 runs in browser 305 and exchanges information and instructionswith server 310 during a design session to support the user'spreparation of a customized product design in electronic form. When thecustomer is satisfied with the design of the product, the design can beuploaded to server 310 for storage and, if desired by the user,subsequent production of the desired quantity of the physical product onappropriate printing and post-print processing systems.

While server 310 is shown in FIG. 3 as a single block, it will beunderstood that server 310 could be multiple servers configured tocommunicate and operate cooperatively to support Web site operations.Server 310 will typically be interacting with many user computersystems, such as UCS 300, simultaneously. Memory 311 represents allcomponents and subsystems that provide server data storage, such as RAM,ROM, and disk drives or arrays. Memory 311 includes the various layouts,designs, colors, fonts, and other information provided by the serviceprovider to enable the creation and rendering of templates. As used inthe embodiment described herein, a markup language product design, suchas template 120, is an XML description that specifies the size, positionand other attributes of all product elements such as text containers,image containers, graphics, z-index values and so forth.

Referring now to FIGS. 4-7D, representative examples of the applicationof the current invention will be discussed. For illustrative purposes,the text fields and templates are shown with generic informationrepresenting the type of data entries that might be made by users. Theentries made by a user in the text fields will be generally referred toherein as “text”, which will be understood to encompass all charactersentered by the user including letters, numbers, punctuation marks,symbols, and the like. FIG. 4 depicts the status of display 100 afterthe entries shown have been made in text fields 101-111, Preview button130 has been activated, and template 120 has been updated to reflect theinformation entered in text fields 101-111. It will be understood thatthe computer system where the updated template 120 image is generated isa design choice of the service provider. Generation of the updatedtemplate 120 image could be performed by browser program 305 usingdownloaded design tools 306 or design tools 306 could adapted totransfer the user's text entries to server 310 where the updatedtemplate 120 image description is prepared and returned to UCS 300 fordisplaying to the user.

Referring to FIG. 5, the textbox arrangement of template 120 accordingto an illustrative embodiment of the invention is depicted. Unlike theprior art technique described above in relation to FIG. 2, the positionsof the textboxes displayed in template 120 are not fixed in advance, butare automatically and dynamically determined each time the user clicksPreview button 130 based on the user-entered information in text fields501-511. Each textbox element 501-511 includes a parameter specifyingits relative position in the textbox order. Spacing distances betweenadjacent displayed textboxes are also specified. A single standardspacing distance between adjacent text elements could be employed ormultiple different distances could be used to provide greater layoutflexibility. In the example depicted in FIGS. 4 and 5, the textboxes areorganized into four groups. The spacing distance between adjacent groupsis relatively larger than the spacing between adjacent textboxes withina group. That is, spacing distances S2, S4 and S7 are relatively largerthan spacing distances S1, S3, S5, S6, S8, S9 and S10 such that fourvisually distinct groups are formed. As will be discussed in more detailbelow, this group spacing is maintained as long as even one textbox in agroup contains text. To avoid placing text extremely close to the upperor lower edge of the design, textboxes cannot be located in definedminimum top (MT) and minimum bottom (MB) spaces.

Referring now to FIG. 6, a representative process for automaticallypositioning elements will be discussed. At step 601, the user enters anydesired text in any one or more of the available text entry fields101-111. The user is not forced to make any entries and, therefore, oneor more of the text fields may be empty when the user requests to viewan updated template 120 by selecting Preview 130.

At step 602, the height in pixels of each textbox containinguser-supplied text is determined. In the disclosed embodiment, thistextbox height value is requested from operating system 303 via a richtext edit control. Alternatively, the value could be obtained frombrowser program 305. At step 603, the heights of all elements to bedisplayed in the available text area are combined to determine theirtotal height. In this example, the heights of all textboxes containinguser text are added to the defined spacing between the textboxes andthis value is compared with the maximum allowable height available foruser text. For the purposes of this calculation, all empty textboxes,and the related textbox separation spacing distances, are ignored. Intemplate 120, the maximum height available for user text placement isthe height of the template minus the minimum top and bottom spaces MTand MB that must remain empty. If a template design includes an image orother design element across the top and/or bottom of the template, theavailable vertical text area would be correspondingly reduced.

If the calculated height of the textboxes having text content andrelated spacing distances does not exceed the maximum allowable height,at step 604 the positions of the textboxes in the available text area122 are determined. The textboxes are arranged in the appropriatevertical sequence and positioned such that approximately one-half of thetotal calculated height is above the horizontal centerline of the textarea and one-half is below the centerline. At step 605, display 100 isupdated to display template 120 with the user's text.

By way of illustration, FIG. 7A depicts the automatically generatedlayout result if the user were to enter “My Name” in text field 103,leaving all other text fields empty, and select Preview 130. In thissituation, because only textbox 503 contains text, the total height H ofthe elements to be displayed in text area 122 is the height of textbox503 and textbox 503 is substantially centered vertically in availabletext area 122.

In FIGS. 7B-7D, discussed below, the outlines of the textboxescontaining the text entries are omitted for clarity of illustration.FIG. 7B illustrates the layout result if the user were to enter “MyCompany” in text field 101, “My Message” in text field 102 and “My Name”in text field 103, leaving all other text fields empty, and selectPreview 130. In this case, the total height H is the sum of the heightsof the associated textboxes 501, 502, and 503 plus the spacing distancesS1 and S2. The textboxes are then positioned in text area 122 such thatsubstantially one-half of the total height H is above the horizontalcenterline of the text area and one-half is below.

As mentioned above, the group spacing is maintained as long as even onetextbox of a group contains text. For example, if the user were to haveentered text only in text fields 101, 106, 110 and 111, that text wouldbe arranged as shown in FIG. 7C. The text “My address 2” in textbox 506is separated from “My Company” in textbox 501 by group spacing distanceS4. Similarly, the entry “xxx@xxxx.xxx” in textbox 510 is separated from“My address 2” in textbox 506 by group spacing distance S7. The totalheight H in this situation is therefore equal to the total of theheights of the four textboxes 501, 506, 510 and 511 plus the spacingdistances S4, S7 and S10. Again, the four textboxes are positioned intext area 122 such that substantially one-half of H is above thehorizontal centerline and one-half below. It will be appreciated that itis not essential that the textboxes always be vertically centered intext area 122. Other positioning techniques could be employed, ifdesired by the service provider.

Referring again to FIG. 6, it is possible that the total height of thetextboxes and textbox spacing determined at step 603 will exceed themaximum allowable height. This would typically occur because the userentered more text in one or more text fields 101-111 than can berendered on a single line at the default font size and fontcharacteristics for that textbox. Each textbox has a defined width thatis, of course, limited by the physical boundaries of the product beingdesigned. If a user enters more text than can be printed on a singleline, the text will automatically wrap onto another line, therebyincreasing the height of the textbox.

It can be appreciated that textboxes with multiple lines will notautomatically require a reduction in the font size or textbox spacing.In some situations, the user may have left one or more text fields101-111 empty, thereby leaving sufficient vertical space available toaccommodate one or more multi-line textboxes. Font size and spacingreductions are only needed if the total of the heights of the textboxeswith text, plus the spacing distances, exceeds the maximum heightavailable for user text.

If it is detected at step 603 that the total height of the textboxes andspacing exceeds the maximum allowable height, the current font sizes andspacing distances are checked at step 606 to determine if they arealready at the size identified by the printing services provider asbeing the minimum that provides an attractive and legible product. Ifthe font sizes and spacing distances are not at the minimum, at step 607the font size for all textboxes are reduced by one point size or, iffont sizes are defined in pixels, by one pixel. If the font sizes havebeen reduced to their minimums, the spacing distances between alltextboxes are incrementally reduced by one pixel until the spacingdistances reach their defined minimums. If the fonts and spacing areboth at the minimums, an alert is generated at step 608 to notify theuser that an acceptable automated layout cannot be generated. It will beunderstood that various alternate techniques of incremental reductionscould be employed, for example: maintaining fixed spacing distances andincrementally reducing only the font sizes, alternately reducing fontsize and spacing size until both are at their minimums, reducing thefont sizes or spacing for only some textboxes instead of all, orreducing font sizes in a proportional manner such that larger fontssizes are reduced by a proportionally greater number of pixels thansmaller font sizes.

After each reduction at step 607, the combined heights of the textboxesand spacing distances are then recalculated at step 602 to determine ifthey no longer exceed the maximum allowable height at step 603. Steps602, 603, 606 and 607 are repeated until either the total height nolonger exceeds the maximum allowable height or the fonts and spacingdistances are at the minimum allowable size as identified by the serviceprovider.

As an example, if all text fields 101-111 contain text entries and atext string that is too long to be rendered on a single line at theinitial font size specified for textbox 502, such as, for illustration,“Message Message Message Message Message”, were entered in text field102, the text would be wrapped onto two lines in textbox 502. Theresulting increased height of textbox 502 would, in this case, cause theoverall total height of all textboxes to exceed to the maximum. The fontsize and spacing of all textboxes would then be reduced incrementallyuntil either the total height of all textboxes does not exceed themaximum available height, for example as depicted in FIG. 7D, or thefont size and spacing distances are at the predefined minimums andcannot be further reduced without unacceptable degradation in thequality or usefulness of the design.

The invention is not limited to dynamic positioning only of textboxes.One or more design elements, for example lines, shapes, images, or otherdesign features, could be similarly vertically positioned within textarea 122 according to which and how many text fields are completed bythe user. FIGS. 8A and 8B show two examples of a business card template800 containing design element 801. Element 801 is assigned a relativeposition and spacing distance between the user entries in the top fourtextboxes and the user entries in the bottom seven textboxes. Like thevertical positions of the textboxes containing user text, the verticalposition of element 801 in template 800 is not fixed, but is determinedby the number and heights of the textboxes containing user data.Referring to step 603 of FIG. 6, the height and associated spacing ofelement 801 is added to the heights of the textboxes and related spacingto calculate the total height of all text area elements.

While the invention has been shown and described in various exemplaryembodiments, the described embodiment is to be considered asillustrative rather than restrictive. For example, the design beingcustomized could be for a product to be printed on paper or on any otherprintable medium such as cloth, glass, plastic, rubber, or wood. Thedesign could be for a complete product, or intended to be incorporatedinto a larger product, such as a section, side, or page. The scope ofthe invention is as indicated in the following claims and all equivalentmethods and apparatus.

1) A computer-implemented method for automatically positioning aplurality of text elements in an area of a markup language design of atleast a portion of a document to be printed, the method comprising:defining a plurality of text elements having a defined verticalpositioning order, defining one or more vertical spacing distances,allowing a user to specify text content for individual text elements,determining at least the height of each text element having textcontent, and based on at least the determined text element heights, oneor more spacing distances, and the defined positioning order,determining a position in the area for each text element having textcontent such that each text element in the area is vertically separatedfrom each adjacent text element by a defined spacing distance, wherebythe layout of the text elements having text content is determined. 2.The method of claim 1 wherein the text elements having text content arepositioned in the area such that the text elements are substantiallycentered vertically within the area
 3. The method of claim 1 furthercomprising defining one or more design elements, each design elementhaving a defined order position in the vertical display order of thetext elements and wherein determining a position in the area for thetext elements having text content further comprises determining aposition in the area for the one or more design elements according tothe defined display order.
 4. The method of claim 1 wherein each of atleast some of the defined text elements are assigned to one of aplurality of text element types and wherein the text elements havingtext content are positioned such that the spacing distance between twosequentially positioned text elements of the same type is smaller thanthe spacing distance between two sequential positioned text elements notof the same type. 5) The method of claim 1 further comprisingdetermining the total combined height of all text elements having textcontent and the spacing distances between the text elements beforedetermining a position for the text elements and, if the total combinedheight is greater than the height of the area, iteratively reducing atleast the text font size of at least some of the text elements,determining a new height of each text element having text content at thereduced font size, and determining a new total combined height until thetotal combined height is less than or equal to the available height ofthe area.
 6. The method of claim 5 wherein iteratively reducing at leastthe text font size further includes iteratively reducing one or morespacing distances.
 7. The method of claim 5 wherein iteratively reducingat least the text font size further includes determining if the fontsizes have been reduced to at a minimum allowable size and, if so,terminating the font size reduction. 8) A computer-readable mediumhaving encoded therein computer instructions for automaticallypositioning a plurality of text elements in an area of a markup languagedesign of at least a portion of a document to be printed, theinstructions comprising instructions for: defining a plurality of textelements having a defined vertical positioning order, defining one ormore vertical spacing distances, allowing a user to specify text contentfor individual text elements, determining at least the height of eachtext element having text content, and based on at least the determinedtext element heights, one or more spacing distances, and the definedpositioning order, determining a position in the area for each textelement having text content such that each text element in the area isvertically separated from each adjacent text element by a definedspacing distance, whereby the layout of the text elements having textcontent is determined.
 9. The computer-readable medium of claim 8wherein the text elements having text content are positioned in the areasuch that the text elements are substantially centered vertically withinthe area
 10. The computer-readable medium of claim 8 further comprisinginstructions for defining one or more design elements, each designelement having a defined order position in the vertical display order ofthe text elements and wherein determining a position in the area for thetext elements having text content further comprises determining aposition in the area for the one or more design elements according tothe defined display order.
 11. The computer-readable medium of claim 8wherein each of at least some of the defined text elements are assignedto one of a plurality of text element types and wherein the textelements having text content are positioned such that the spacingdistance between two sequentially positioned text elements of the sametype is smaller than the spacing distance between two sequentialpositioned text elements not of the same type.
 12. The computer-readablemedium of claim 8 further comprising instructions for determining thetotal combined height of all text elements having text content and thedefined spacing distances between the text elements before determining aposition for the text elements and, if the total combined height isgreater than the height of the area, iteratively reducing at least thetext font size of at least some of the text elements, determining a newheight of each text element having text content at the reduced fontsize, and determining a new total combined height until the totalcombined height is less than or equal to the available height of thearea.
 13. The computer-readable medium of claim 8 wherein iterativelyreducing at least the text font size further includes iterativelyreducing one or more spacing distances.
 14. The computer-readable mediumof claim 8 wherein iteratively reducing at least the text font sizefurther includes determining if the font sizes have been reduced to at aminimum allowable size and, if so, terminating the font size reduction.